﻿using Core.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Core.IService
{
    public interface IBaseService<T> where T : BaseModel, new()
    {
        Task<int> AddAsync(T obj);
        Task<int> EditAsync(T obj);
        Task<int> DeleteAsync(int id);

        Task<T> GetEnityAsync(Expression<Func<T, bool>> expression);

        IQueryable<T> GetList(Expression<Func<T, bool>> expression=null);

        IQueryable<T> GetList<TOrder>(Expression<Func<T, bool>> expression, int pageSize, int pageIndex, out int total, Expression<Func<T, TOrder>> order, bool IsAsc = true);
    }
}
